// 账号，密码校验：英文字符（不区分大小写），数字，特殊符号
let accountNumber = /^[0-9a-zA-Z~!@#$%^&*()-_+={[}\]:;"'<,>.?/]*$/;
// mac地址校验：英文字符（不区分大小写），数字，-
let macAddress = /(^[A-F0-9]{2}([-][A-F0-9]{2}){5}$)|(^[A-F0-9]{2}([/][A-F0-9]{2}){5}$)|(^[A-F0-9]{2}([:][A-F0-9]{2}){5}$)|(^[A-F0-9]{2}([.][A-F0-9]{2}){5}$)|(^[A-F0-9]{2}([ ][A-F0-9]{2}){5}$)|(^[A-F0-9]{4}([-][A-F0-9]{4}){2}$)|(^[A-F0-9]{4}([/][A-F0-9]{4}){2}$)|(^[A-F0-9]{4}([:][A-F0-9]{4}){2}$)|(^[A-F0-9]{4}([.][A-F0-9]{4}){2}$)|(^[A-F0-9]{4}([ ][A-F0-9]{4}){2}$)/i;

// 身份证号码验证
let identity = /^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i;

// 登录账号校验：英文字符（不区分大小写），数字，特殊符号(@-_.)
let loginAccount = /^[0-9a-zA-Z@-_.]*$/;

// 自定义属性名称校验
let userDefinedName = /^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9]){1,20}$/;

// IPv4校验
let IPv4 = /^(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))$/;

// IPv6校验
let IPv6 = /^([\\da-fA-F]{1,4}:){7}([\\da-fA-F]{1,4})$/;

export default {
  accountNumber,
  macAddress,
  identity,
  loginAccount,
  userDefinedName,
  IPv4,
  IPv6
};
